//
//  NewsCell.m
//  时光电影项目
//
//  Created by 墨狂之逸才 on 15/7/21.
//  Copyright (c) 2015年 墨狂之逸才. All rights reserved.
//

#import "NewsCell.h"
#import "UIImageView+WebCache.h"
@implementation NewsCell

- (void)awakeFromNib {
    // Initialization code
       self.selectionStyle = UITableViewCellSelectionStyleNone;
       [self setNeedsLayout];
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    
    //将模型数据的内容传给cell
    self.title.text = self.newsModal.title;

    self.summary.text = self.newsModal.summary;

    self.type.tag = self.newsModal.type;
    
    if (self.type.tag == 1) {
        self.type.hidden = NO;
    }
    else
    {
        self.type.hidden = YES;
    
    }
    
//    self.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"poster_title_home"]];
    
    //获取网络的图片，调用第三方库的方法
//    NSString *medium = [self.newsModal.image objectForKey:@"medium"];
    [self.iconImage sd_setImageWithURL:[NSURL URLWithString:self.newsModal.image]];
    
    
    //设置全局的cell不被选中的样式
//    self.selectionStyle = UITableViewCellSelectionStyleNone;
    
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
